package model

import "time"

// 请求参数
type PublicParam struct {
	Page     int `json:"page" form:"page,default=1" `
	PageSize int `json:"page_size" form:"page_size,default=10"`
}

type QueryTrainLogDetailReq struct {
	SessionId int `json:"session_id" form:"session_id"`
}

type Dialogue struct {
	Id             uint     `json:"id"`
	QuestionId     uint     `json:"question_id"`
	Question       string   `json:"question"`
	Answer         string   `json:"answer"`
	AudioUrl       string   `json:"audio_url"`
	SpeakTime      uint     `json:"speak_time"`
	QuestionType   int      `json:"question_type"`
	AnsAnalysis    string   `json:"ans_analysis"`
	BelongToId     uint     `json:"belong_to_id"`
	CurrentTag     uint     `json:"current_tag"`
	AnsAnalysisTag []string `json:"ans_analysis_tag"`
}

type ExportTrainLog struct {
	School     int    `json:"school" form:"school"`
	Academy    int    `json:"academy" form:"academy"`
	Profession int    `json:"profession" form:"profession"`
	Grade      string `json:"grade" form:"grade"`
	Education  string `json:"education" form:"education"`
	Query      string `json:"query" form:"query"`
	StartTime  string `json:"start_time" form:"start_time"`
	EndTime    string `json:"end_time" form:"end_time"`
}

type QueryTrainLog struct {
	Page          int    `json:"page" form:"page,default=1" `
	PageSize      int    `json:"page_size" form:"page_size,default=10"`
	Query         string `json:"query" form:"query"`
	Type          string `json:"type" form:"type"`
	School        int    `json:"school" form:"school"`
	Academy       int    `json:"academy" form:"academy"`
	Profession    int    `json:"profession" form:"profession"`
	Grade         string `json:"grade" form:"grade"`
	StartTime     string `json:"start_time" form:"start_time"`
	EndTime       string `json:"end_time" form:"end_time"`
	Education     string `json:"education" form:"education"`
	StartDuration int    `json:"start_duration" form:"start_duration"`
	EndDuration   int    `json:"end_duration" form:"end_duration"`
	StartScore    int    `json:"start_score" form:"start_score" default:"0"`
	EndScore      int    `json:"end_score" form:"end_score" default:"100"`
	Opt           int    `json:"opt" form:"opt" default:"1"`
}

type QueryTrainLogReq struct {
	QueryTrainLog
	Career int  `json:"career" form:"career"`
	IsAll  bool `json:"is_all" form:"is_all"`
}

type QueryTrainLogReqThird struct {
	Career string `json:"career" form:"career"`
	IsAll  bool   `json:"is_all" form:"is_all"`
	QueryTrainLog
}

// 删除记录
type TrainLogIdsReq struct {
	Ids []int `json:"ids" form:"ids"`
}

// 面试记录响应体
type QueryTrainLogResp struct {
	Id             uint      `json:"id" write:"false"`
	Name           string    `json:"name" write:"true"`
	Sno            string    `json:"sno" write:"true"`
	Phone          string    `json:"phone" write:"true"`
	School         string    `json:"school" write:"true"`
	Academy        string    `json:"academy" write:"true"`
	Profession     string    `json:"profession" write:"true"`
	Education      string    `json:"education" write:"true"`
	Grade          string    `json:"grade" write:"true"`
	Career         string    `json:"career" write:"true"`
	ReportUrl      string    `json:"report_url" write:"false"`
	Score          int       `json:"score" write:"true"`
	Duration       string    `json:"duration" write:"true"`
	FinishTime     string    `json:"finish_time" write:"true"`
	FinishTimeObj  time.Time `json:"-" write:"false"`
	TrainTime      string    `json:"train_time" write:"false"`
	TrainTimeObj   time.Time `json:"-" write:"false"`
	Status         uint      `json:"status" write:"false"`
	Type           string    `json:"type" write:"false"`
	ReportType     string    `json:"report_type" write:"false"`
	CareerId       uint      `json:"-" write:"false"`
	ReportIsSync   bool      `json:"report_is_sync" write:"false"`
	AgentIsSync    bool      `json:"agent_is_sync" write:"false"`
	TrainFrequency int       `json:"train_frequency" write:"false"`
}

// 面试记录列表
type QueryTrainLogListResp struct {
	UserId     uint   `json:"user_id" write:"false"`
	SessionId  uint   `json:"id" write:"false"`
	UserName   string `json:"user_name" write:"true"`
	Sno        string `json:"sno" write:"true"`
	Phone      string `json:"user_phone" write:"true"`
	School     string `json:"school" write:"true"`
	Academy    string `json:"academy" write:"true"`
	Profession string `json:"profession" write:"true"`
	Education  string `json:"education" write:"true"`
	Grade      string `json:"grade" write:"true"`
	TrainCount uint   `json:"count" write:"train_count"` // 训练次数
}

type QueryTrainLogDetailResp struct {
	SessionId int        `json:"session_id"`
	Dialogue  []Dialogue `json:"dialogue"`
}

type CfgInfo struct {
	Id         uint   `json:"id"`
	Type       string `json:"type"`
	Name       string `json:"name"`
	BelongToId uint   `json:"belong_to_id"`
	AgentId    uint   `json:"agent_id"`
}

type CfgInfos struct {
	Id    uint       `json:"id"`
	Type  string     `json:"type"`
	Name  string     `json:"name"`
	Value []CfgInfos `json:"value"`
}
